<?php

$org = $vars['entity'];
$users = $org->getManagers();
$baseDeleteLink = $CONFIG->url."action/organizations/remove_admin?o=".$org->guid."&u=";
?>
<?php if(count($users)): ?>
<style>
td
{
	vertical-align: middle;
}
</style>
<br>
<table class="elgg-table">
<thead>
	<tr>
		<th width="40">&nbsp;</th>
		<th>Nombre</th>
		<th>Email</th>
		<th>&nbsp;</th>
	</tr>
</thead>
<tbody>
	<?php foreach ($users as $user): ?>
		<tr>
			<td><?php echo elgg_view_entity_icon($user, 'small', array('href' => '')); ?></td>
			<td>
				<?php 
					echo elgg_view("output/url",
					array('href' => $user->getUrl(),'text' => $user->username));
				?>
			</td>
			<td><?php echo $user->email; ?></td>
			<td>
				<?php
					echo elgg_view("output/confirmlink",
					array('href' => $baseDeleteLink.$user->guid,'text' => elgg_echo('delete'),
					'confirm' => elgg_echo('deleteconfirm'),'class' => 'elgg-button elgg-button-cancel',));
				?>
			</td>
		</tr>
	<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
	<br>
	<p> No hay administradores aqui</p>
<?php endif; ?>

<?php
$form_vars = array(
	'class' => 'elgg-form-alt',
);

set_input('o', $org->guid);
echo elgg_view_form('organizations/add_admin',$form_vars);
?>